#include "game.h"
#include "object.h"
#include <iostream>
#include <ctime>
#include "scene.h"

extern CScene OScene;

using namespace std;

CObject::CObject() {
    x = 0;
    y = 0;
    opdelay = 20;
    id = OScene.requestNewID();
}

CObject::~CObject() {

}

CObject::CObject(int tx, int ty) {
    x = tx;
    y = ty;
    opdelay = 20;
}

void CObject::SetX(int tx) {
    x = tx;
}

void CObject::SetY(int ty) {
    y = ty;
}

int CObject::GetX() {
    return x;
}

int CObject::GetY() {
    return y;
}

void CObject::Move(int xx, int xy) {
    x += xx;
    y += xy;
}

void CObject::MoveTo(int xx, int xy) {
    x = xx;
    y = xy;
}

void CObject::Do() {

}

void CObject::Draw() {

}

void CObject::resetTime() {
    lasttime = SDL_GetTicks();
}

int CObject::getTicks() {
    return SDL_GetTicks() - lasttime;
}

void CObject::setTime(int to) {
    lasttime = to;
}

void CObject::SetOpDelay(int to) {
    opdelay = to;
}

int CObject::GetOpDelay() {
    return opdelay;
}

int CObject::getTime() {
    return lasttime;
}

bool CObject::isCreep() {
    return false;
}

int CObject::GetH() {
    return h;
}

int CObject::GetW() {
    return w;
}

void CObject::SetH(int th) {
    h = th;
}

void CObject::SetW(int tw) {
    w = tw;
}

int CObject::GetID() {
    return id;
}

void CObject::Damage(int what) {

}

void CObject::SetDMG(int td) {
    dmg = td;
}

void CObject::SetRadius(int tr) {
    radius = tr;
}

void CObject::SetSpeedRatio(int tr) {
    speedratio = tr;
}

int CObject::GetDMG() {
    return dmg;
}

int CObject::GetRadius() {
    return radius;
}

int CObject::GetSpeedRatio() {
    return speedratio;
}
